
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<!--[if IE 8 ]><html dir="ltr" lang="zh_cn" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="ltr" lang="zh_cn" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="ltr" lang="zh_cn">
<!--<![endif]-->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>地址管理</title>
<!-- <base href="../../mobile/index.html" /> -->

<!-- Facebook share -->
<meta property="og:site_name" content="PHP 开源电商系统 - 成都光大网络科技" />
<meta property="og:url" content="../../mobile/account/address_add.html?address_id=244" />
<meta property="og:type" content="website" />
<meta property="og:title" content="地址管理" />
<meta property="og:description" content="" />
<meta property="og:image" content="../../image/logo-600x315.png" />
<meta property="og:image:width" content="600" />
<meta property="og:image:height" content="315" />

<link href="../../javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="../../javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" media="screen" />
<script src="../../javascript/app.js?v=c276af9139" type="text/javascript"></script>
<script src="../../javascript/jquery/datetimepicker/moment/moment.min.js" type="text/javascript"></script>
<script src="../../javascript/jquery/datetimepicker/moment/moment-with-locales.min.js" type="text/javascript"></script>
<script src="../../javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<link href="../../image/favicon.png" rel="icon" />
<link href="../../theme/mobile/stylesheet/stylesheet.css?v=7000b9778f" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../src/DebugBar/Resources/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../../src/DebugBar/Resources/vendor/highlightjs/styles/github.css">
<link rel="stylesheet" type="text/css" href="../../src/DebugBar/Resources/debugbar.css">
<link rel="stylesheet" type="text/css" href="../../src/DebugBar/Resources/widgets.css">
<link rel="stylesheet" type="text/css" href="../../src/DebugBar/Resources/openhandler.css">
<link rel="stylesheet" type="text/css" href="../../src/DebugBar/Resources/widgets/sqlqueries/widget.css">
<script type="text/javascript" src="../../src/DebugBar/Resources/vendor/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="../../src/DebugBar/Resources/vendor/highlightjs/highlight.pack.js"></script>
<script type="text/javascript" src="../../src/DebugBar/Resources/debugbar.js"></script>
<script type="text/javascript" src="../../src/DebugBar/Resources/widgets.js"></script>
<script type="text/javascript" src="../../src/DebugBar/Resources/openhandler.js"></script>
<script type="text/javascript" src="../../src/DebugBar/Resources/widgets/sqlqueries/widget.js"></script>
<script type="text/javascript">jQuery.noConflict(true);</script>

</head>
<body class="account-address-edit" ontouchstart="" onmouseover="">

  <div class="assist-side">
        <a class="btn-meiqia"><i class="iconfont">&#xe607;</i></a>
    <script type='text/javascript'>
      (function(m, ei, q, i, a, j, s) {
        m[i] = m[i] || function() {
          (m[i].a = m[i].a || []).push(arguments)
        };
        j = ei.createElement(q),
          s = ei.getElementsByTagName(q)[0];
        j.async = true;
        j.charset = 'UTF-8';
        j.src = 'https://static.meiqia.com/dist/meiqia.js?_=t';
        s.parentNode.insertBefore(j, s);
      })(window, document, 'script', '_MEIQIA');
      _MEIQIA('entId', '116919');
      _MEIQIA('language', 'zh');
      _MEIQIA('manualInit'); // 在这里开启手动模式
      _MEIQIA('withoutBtn'); // 不显示默认按钮
      _MEIQIA('init');

      $(document).on('click', '.btn-meiqia', function(event) {
        _MEIQIA('showPanel');
      });
    </script>
            <a href="../../mobile/index.html"><i class="iconfont">&#xe629;</i></a>
        <a href="#page-top" class="go-top"><i class="iconfont">&#xe6fe;</i></a>
  </div>

<div id="account-address" class="container">
  <ul class="breadcrumb">
    <li><a href="../../mobile/index.html"><i class="fa fa-home"></i></a></li>
    <li><a href="../../mobile/account.html">会员中心</a></li>
    <li><a href="../../mobile/account/address">地址管理</a></li>
    <li><a href="../../mobile/account/address/edit.html?address_id=244">编辑地址</a></li>
  </ul>

  <div class="row">
                <div id="content" class="col-sm-12">
      <div class="nav-bar">编辑地址</div>
      <div class="row widget">
        <div class="col-xs-12">
          <form action="../../mobile/account/address/edit.html?address_id=244" method="post" enctype="multipart/form-data" class="form-horizontal">
            <fieldset>
              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-firstname">姓名</label>
                <div class="col-sm-10">
                  <input type="text" name="firstname" value="gzelink" placeholder="姓名" id="input-firstname" class="form-control" />
                                  </div>
              </div>

              <div class="form-group required hidden">
                <label class="col-sm-2 control-label" for="input-lastname">姓氏</label>
                <div class="col-sm-10">
                  <input type="text" name="lastname" value="" placeholder="姓氏" id="input-lastname" class="form-control" />
                                  </div>
              </div>

              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-telephone">联系电话</label>
                <div class="col-sm-10">
                    <input type="hidden" name="calling_code" value="86">
  <input name="telephone" value="13700000000" placeholder="联系电话" id="input-telephone"
         class="form-control"/>

                                  </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label" for="input-company">公司名称</label>
                <div class="col-sm-10">
                  <input type="text" name="company" value="" placeholder="公司名称" id="input-company" class="form-control" />
                </div>
              </div>

              <!-- country -->
              <div class="form-group required hidden">
                <label class="col-sm-2 control-label" for="input-country">国家</label>
                <div class="col-sm-10">
                  <select name="country_id" id="input-country-id" class="form-control" autocomplete="new-country-id">
                    <option value=""> -- 请选择 -- </option>
                                          <option value="44" selected="selected">中国</option>
                                          <option value="244" >Aaland Islands</option>
                                          <option value="1" >Afghanistan</option>
                                          <option value="2" >Albania</option>
                                          <option value="3" >Algeria</option>
                                          <option value="4" >American Samoa</option>
                                          <option value="5" >Andorra</option>
                                          <option value="6" >Angola</option>
                                          <option value="7" >Anguilla</option>
                                          <option value="8" >Antarctica</option>
                                          <option value="9" >Antigua and Barbuda</option>
                                          <option value="10" >Argentina</option>
                                          <option value="11" >Armenia</option>
                                          <option value="12" >Aruba</option>
                                          <option value="252" >Ascension Island (British)</option>
                                          <option value="13" >Australia</option>
                                          <option value="14" >Austria</option>
                                          <option value="15" >Azerbaijan</option>
                                          <option value="16" >Bahamas</option>
                                          <option value="17" >Bahrain</option>
                                          <option value="18" >Bangladesh</option>
                                          <option value="19" >Barbados</option>
                                          <option value="20" >Belarus</option>
                                          <option value="21" >Belgium</option>
                                          <option value="22" >Belize</option>
                                          <option value="23" >Benin</option>
                                          <option value="24" >Bermuda</option>
                                          <option value="25" >Bhutan</option>
                                          <option value="26" >Bolivia</option>
                                          <option value="245" >Bonaire, Sint Eustatius and Saba</option>
                                          <option value="27" >Bosnia and Herzegovina</option>
                                          <option value="28" >Botswana</option>
                                          <option value="29" >Bouvet Island</option>
                                          <option value="30" >Brazil</option>
                                          <option value="31" >British Indian Ocean Territory</option>
                                          <option value="32" >Brunei Darussalam</option>
                                          <option value="33" >Bulgaria</option>
                                          <option value="34" >Burkina Faso</option>
                                          <option value="35" >Burundi</option>
                                          <option value="36" >Cambodia</option>
                                          <option value="37" >Cameroon</option>
                                          <option value="38" >Canada</option>
                                          <option value="251" >Canary Islands</option>
                                          <option value="39" >Cape Verde</option>
                                          <option value="40" >Cayman Islands</option>
                                          <option value="41" >Central African Republic</option>
                                          <option value="42" >Chad</option>
                                          <option value="43" >Chile</option>
                                          <option value="45" >Christmas Island</option>
                                          <option value="46" >Cocos (Keeling) Islands</option>
                                          <option value="47" >Colombia</option>
                                          <option value="48" >Comoros</option>
                                          <option value="49" >Congo</option>
                                          <option value="50" >Cook Islands</option>
                                          <option value="51" >Costa Rica</option>
                                          <option value="52" >Cote D'Ivoire</option>
                                          <option value="53" >Croatia</option>
                                          <option value="54" >Cuba</option>
                                          <option value="246" >Curacao</option>
                                          <option value="55" >Cyprus</option>
                                          <option value="56" >Czech Republic</option>
                                          <option value="237" >Democratic Republic of Congo</option>
                                          <option value="57" >Denmark</option>
                                          <option value="58" >Djibouti</option>
                                          <option value="59" >Dominica</option>
                                          <option value="60" >Dominican Republic</option>
                                          <option value="61" >East Timor</option>
                                          <option value="62" >Ecuador</option>
                                          <option value="63" >Egypt</option>
                                          <option value="64" >El Salvador</option>
                                          <option value="65" >Equatorial Guinea</option>
                                          <option value="66" >Eritrea</option>
                                          <option value="67" >Estonia</option>
                                          <option value="68" >Ethiopia</option>
                                          <option value="69" >Falkland Islands (Malvinas)</option>
                                          <option value="70" >Faroe Islands</option>
                                          <option value="71" >Fiji</option>
                                          <option value="72" >Finland</option>
                                          <option value="74" >France, Metropolitan</option>
                                          <option value="75" >French Guiana</option>
                                          <option value="76" >French Polynesia</option>
                                          <option value="77" >French Southern Territories</option>
                                          <option value="126" >FYROM</option>
                                          <option value="78" >Gabon</option>
                                          <option value="79" >Gambia</option>
                                          <option value="80" >Georgia</option>
                                          <option value="81" >Germany</option>
                                          <option value="82" >Ghana</option>
                                          <option value="83" >Gibraltar</option>
                                          <option value="84" >Greece</option>
                                          <option value="85" >Greenland</option>
                                          <option value="86" >Grenada</option>
                                          <option value="87" >Guadeloupe</option>
                                          <option value="88" >Guam</option>
                                          <option value="89" >Guatemala</option>
                                          <option value="256" >Guernsey</option>
                                          <option value="90" >Guinea</option>
                                          <option value="91" >Guinea-Bissau</option>
                                          <option value="92" >Guyana</option>
                                          <option value="93" >Haiti</option>
                                          <option value="94" >Heard and Mc Donald Islands</option>
                                          <option value="95" >Honduras</option>
                                          <option value="96" >Hongkong, China</option>
                                          <option value="97" >Hungary</option>
                                          <option value="98" >Iceland</option>
                                          <option value="99" >India</option>
                                          <option value="100" >Indonesia</option>
                                          <option value="101" >Iran (Islamic Republic of)</option>
                                          <option value="102" >Iraq</option>
                                          <option value="103" >Ireland</option>
                                          <option value="254" >Isle of Man</option>
                                          <option value="104" >Israel</option>
                                          <option value="105" >Italy</option>
                                          <option value="106" >Jamaica</option>
                                          <option value="107" >Japan</option>
                                          <option value="257" >Jersey</option>
                                          <option value="108" >Jordan</option>
                                          <option value="109" >Kazakhstan</option>
                                          <option value="110" >Kenya</option>
                                          <option value="111" >Kiribati</option>
                                          <option value="253" >Kosovo, Republic of</option>
                                          <option value="114" >Kuwait</option>
                                          <option value="115" >Kyrgyzstan</option>
                                          <option value="116" >Lao People's Democratic Republic</option>
                                          <option value="117" >Latvia</option>
                                          <option value="118" >Lebanon</option>
                                          <option value="119" >Lesotho</option>
                                          <option value="120" >Liberia</option>
                                          <option value="121" >Libyan Arab Jamahiriya</option>
                                          <option value="122" >Liechtenstein</option>
                                          <option value="123" >Lithuania</option>
                                          <option value="124" >Luxembourg</option>
                                          <option value="127" >Madagascar</option>
                                          <option value="128" >Malawi</option>
                                          <option value="129" >Malaysia</option>
                                          <option value="130" >Maldives</option>
                                          <option value="131" >Mali</option>
                                          <option value="132" >Malta</option>
                                          <option value="133" >Marshall Islands</option>
                                          <option value="134" >Martinique</option>
                                          <option value="135" >Mauritania</option>
                                          <option value="136" >Mauritius</option>
                                          <option value="137" >Mayotte</option>
                                          <option value="138" >Mexico</option>
                                          <option value="139" >Micronesia, Federated States of</option>
                                          <option value="140" >Moldova, Republic of</option>
                                          <option value="141" >Monaco</option>
                                          <option value="142" >Mongolia</option>
                                          <option value="242" >Montenegro</option>
                                          <option value="143" >Montserrat</option>
                                          <option value="144" >Morocco</option>
                                          <option value="145" >Mozambique</option>
                                          <option value="146" >Myanmar</option>
                                          <option value="147" >Namibia</option>
                                          <option value="148" >Nauru</option>
                                          <option value="149" >Nepal</option>
                                          <option value="150" >Netherlands</option>
                                          <option value="151" >Netherlands Antilles</option>
                                          <option value="152" >New Caledonia</option>
                                          <option value="153" >New Zealand</option>
                                          <option value="154" >Nicaragua</option>
                                          <option value="155" >Niger</option>
                                          <option value="156" >Nigeria</option>
                                          <option value="157" >Niue</option>
                                          <option value="158" >Norfolk Island</option>
                                          <option value="112" >North Korea</option>
                                          <option value="159" >Northern Mariana Islands</option>
                                          <option value="160" >Norway</option>
                                          <option value="161" >Oman</option>
                                          <option value="162" >Pakistan</option>
                                          <option value="163" >Palau</option>
                                          <option value="247" >Palestinian Territory, Occupied</option>
                                          <option value="164" >Panama</option>
                                          <option value="165" >Papua New Guinea</option>
                                          <option value="166" >Paraguay</option>
                                          <option value="167" >Peru</option>
                                          <option value="168" >Philippines</option>
                                          <option value="169" >Pitcairn</option>
                                          <option value="170" >Poland</option>
                                          <option value="171" >Portugal</option>
                                          <option value="172" >Puerto Rico</option>
                                          <option value="173" >Qatar</option>
                                          <option value="174" >Reunion</option>
                                          <option value="175" >Romania</option>
                                          <option value="176" >Russian Federation</option>
                                          <option value="177" >Rwanda</option>
                                          <option value="178" >Saint Kitts and Nevis</option>
                                          <option value="179" >Saint Lucia</option>
                                          <option value="180" >Saint Vincent and the Grenadines</option>
                                          <option value="181" >Samoa</option>
                                          <option value="182" >San Marino</option>
                                          <option value="183" >Sao Tome and Principe</option>
                                          <option value="184" >Saudi Arabia</option>
                                          <option value="185" >Senegal</option>
                                          <option value="243" >Serbia</option>
                                          <option value="186" >Seychelles</option>
                                          <option value="187" >Sierra Leone</option>
                                          <option value="188" >Singapore</option>
                                          <option value="189" >Slovak Republic</option>
                                          <option value="190" >Slovenia</option>
                                          <option value="191" >Solomon Islands</option>
                                          <option value="192" >Somalia</option>
                                          <option value="193" >South Africa</option>
                                          <option value="194" >South Georgia &amp; South Sandwich Islands</option>
                                          <option value="113" >South Korea</option>
                                          <option value="248" >South Sudan</option>
                                          <option value="195" >Spain</option>
                                          <option value="196" >Sri Lanka</option>
                                          <option value="249" >St. Barthelemy</option>
                                          <option value="197" >St. Helena</option>
                                          <option value="250" >St. Martin (French part)</option>
                                          <option value="198" >St. Pierre and Miquelon</option>
                                          <option value="199" >Sudan</option>
                                          <option value="200" >Suriname</option>
                                          <option value="201" >Svalbard and Jan Mayen Islands</option>
                                          <option value="202" >Swaziland</option>
                                          <option value="203" >Sweden</option>
                                          <option value="204" >Switzerland</option>
                                          <option value="205" >Syrian Arab Republic</option>
                                          <option value="206" >Taiwan, China</option>
                                          <option value="207" >Tajikistan</option>
                                          <option value="208" >Tanzania, United Republic of</option>
                                          <option value="209" >Thailand</option>
                                          <option value="210" >Togo</option>
                                          <option value="211" >Tokelau</option>
                                          <option value="212" >Tonga</option>
                                          <option value="213" >Trinidad and Tobago</option>
                                          <option value="255" >Tristan da Cunha</option>
                                          <option value="214" >Tunisia</option>
                                          <option value="215" >Turkey</option>
                                          <option value="216" >Turkmenistan</option>
                                          <option value="217" >Turks and Caicos Islands</option>
                                          <option value="218" >Tuvalu</option>
                                          <option value="219" >Uganda</option>
                                          <option value="220" >Ukraine</option>
                                          <option value="221" >United Arab Emirates</option>
                                          <option value="222" >United Kingdom</option>
                                          <option value="223" >United States</option>
                                          <option value="224" >United States Minor Outlying Islands</option>
                                          <option value="225" >Uruguay</option>
                                          <option value="226" >Uzbekistan</option>
                                          <option value="227" >Vanuatu</option>
                                          <option value="228" >Vatican City State (Holy See)</option>
                                          <option value="229" >Venezuela</option>
                                          <option value="230" >Viet Nam</option>
                                          <option value="231" >Virgin Islands (British)</option>
                                          <option value="232" >Virgin Islands (U.S.)</option>
                                          <option value="233" >Wallis and Futuna Islands</option>
                                          <option value="234" >Western Sahara</option>
                                          <option value="235" >Yemen</option>
                                          <option value="238" >Zambia</option>
                                          <option value="239" >Zimbabwe</option>
                                      </select>
                                  </div>
              </div>

              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-zone-id">省份</label>
                <div class="col-sm-10">
                  <select name="zone_id" id="input-zone" class="form-control"></select>
                                  </div>
              </div>

              <div class="form-group required hidden">
                <label class="col-sm-2 control-label" for="input-city-id">城市</label>
                <div class="col-sm-10">
                  <select name="city_id" id="input-city" class="form-control"></select>
                                  </div>
              </div>
              <div class="form-group required hidden">
                <label class="col-sm-2 control-label" for="input-county-id">城镇/区域</label>
                <div class="col-sm-10">
                  <select name="county_id" id="input-county-id" class="form-control"></select>
                                  </div>
              </div>
              <div class="form-group required hidden">
                <label class="col-sm-2 control-label" for="input-city">城市</label>
                <div class="col-sm-10">
                  <input type="text" name="city" value="广州市" placeholder="城市" id="input-city" class="form-control" />
                                  </div>
              </div>

              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-address-1">详细地址</label>
                <div class="col-sm-10">
                  <input type="text" name="address_1" value="五羊邨" placeholder="详细地址" id="input-address-1" class="form-control" />
                                  </div>
              </div>

              <div class="form-group hidden">
                <label class="col-sm-2 control-label" for="input-address-2">地址行 2</label>
                <div class="col-sm-10">
                  <input type="text" name="address_2" value="" placeholder="地址行 2" id="input-address-2" class="form-control" />
                </div>
              </div>

              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-postcode">邮政编码</label>
                <div class="col-sm-10">
                  <input type="text" name="postcode" value="525300" placeholder="邮政编码" id="input-postcode" class="form-control" />
                                  </div>
              </div>

                            <div class="form-group">
                <label class="col-sm-2 control-label">默认地址</label>
                <div class="col-sm-10">
                  <label class="radio-inline">
                    <input type="radio" name="default" value="1"  />
                    是
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="default" value="0" checked="checked" />
                    否
                  </label>
                </div>
              </div>
            </fieldset>
            <div class="buttons clearfix">
              <div class="pull-right">
                <input type="submit" value="提交" class="btn btn-primary" />
              </div>
            </div>
          </form>
        </div>
      </div>
      </div>
    </div>
</div>
<script type="text/javascript"><!--
// Sort the custom fields
$('.form-group[data-sort]').detach().each(function() {
  if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('.form-group').length - 2) {
    $('.form-group').eq(parseInt($(this).attr('data-sort')) + 2).before(this);
  }

  if ($(this).attr('data-sort') > $('.form-group').length - 2) {
    $('.form-group:last').after(this);
  }

  if ($(this).attr('data-sort') == $('.form-group').length - 2) {
    $('.form-group:last').after(this);
  }

  if ($(this).attr('data-sort') < -$('.form-group').length - 2) {
    $('.form-group:first').before(this);
  }
});
//--></script>
<script type="text/javascript"><!--
$('button[id^="button-custom-field"]').on('click', function() {
  var element = this;

  $('#form-upload').remove();

  $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

  $('#form-upload input[name="file"]').trigger('click');

  if (typeof timer != 'undefined') {
    clearInterval(timer);
  }

  timer = setInterval(function() {
    if ($('#form-upload input[name="file"]').val() != '') {
      clearInterval(timer);

      $.ajax({
        url: 'index.php?route=tool/upload',
        type: 'post',
        dataType: 'json',
        data: new FormData($('#form-upload')[0]),
        cache: false,
        contentType: false,
        processData: false,
        beforeSend: function() {
          $(element).button('loading');
        },
        complete: function() {
          $(element).button('reset');
        },
        success: function(json) {
          $(element).parent().find('.text-danger').remove();

          if (json['error']) {
            $(element).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
          }

          if (json['success']) {
            alert(json['success']);

            $(element).parent().find('input').val(json['code']);
          }
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
      });
    }
  }, 500);
});
//--></script>
<script type="text/javascript"><!--
$('.date').datetimepicker({
  language: 'en-gb',
  pickTime: false
});

$('.datetime').datetimepicker({
  language: 'en-gb',
  pickDate: true,
  pickTime: true
});

$('.time').datetimepicker({
  language: 'en-gb',
  pickDate: false
});
//--></script>
<script type="text/javascript"><!--
$('select[name="country_id"]').on('change', function() {
  $.ajax({
    url: 'index.php?route=account/account/country&country_id=' + this.value,
    dataType: 'json',
    beforeSend: function() {
      $('select[name="country_id"] .text-danger').remove();
      $('select[name="country_id"]').prop('disabled', true);
      $('select[name="city_id"]').closest('.form-group').addClass('hidden');
      $('select[name="county_id"]').closest('.form-group').addClass('hidden');
      $('input[name="city"]').closest('.form-group').addClass('hidden');
    },
    complete: function() {
      //
    },
    success: function(json) {
      $('select[name="country_id"]').prop('disabled', false);

      if (json['postcode_required'] == '1') {
        $('input[name="postcode"]').closest('.form-group').addClass('required');
      } else {
        $('input[name="postcode"]').closest('.form-group').removeClass('required');
      }

      html = '<option value=""> -- 请选择 -- </option>';

      if (json['zone'] && json['zone'] != '') {
        for (i = 0; i < json['zone'].length; i++) {
          html += '<option value="' + json['zone'][i]['zone_id'] + '"';

          if (json['zone'][i]['zone_id'] == '689') {
            html += ' selected="selected"';
          }

          html += '>' + json['zone'][i]['name'] + '</option>';
        }
      }

      $('select[name="zone_id"]').html(html);
      $('select[name="city_id"]').html('');
      $('select[name="county_id"]').html('');

      if ($('select[name="zone_id"] option:selected').val() > 0) {
        $('select[name="zone_id"]').trigger('change');
      }
    },
    error: function(xhr, ajaxOptions, thrownError) {
      $('select[name="country_id"]').after('<div class="text-danger">' + xhr.responseText + '</div>');
    }
  });
});

$('select[name="country_id"]').trigger('change');

var showCityOrCountyOptions = function(currentEl, changeEl, isTop, cityId, callback) {
  var zoneId = currentEl.val();
  if (zoneId == null) return;
  var requestUrl = 'index.php?route=account/account/zone&zone_id=' + zoneId + '&is_top=' + isTop;
  $.ajax({
    url: requestUrl,
    dataType: 'json',
    beforeSend: function () {
      currentEl.prop('disabled', true);
      changeEl.prop('disabled', true);
    },
    complete: function () {
      //
    },
    success: function (json) {
      currentEl.prop('disabled', false);
      changeEl.prop('disabled', false);

      html = '<option value=""> -- 请选择 -- </option>';
      if (json['city'] && json['city'] != '') {
        for (i = 0; i < json['city'].length; i++) {
          html += '<option value="' + json['city'][i]['city_id'] + '"';
          if (json['city'][i]['city_id'] == cityId) {
            html += ' selected="selected"';
          }
          html += '>' + json['city'][i]['name'] + '</option>';
        }
      }
      changeEl.html(html);
      if (typeof(callback) == 'function') {
        callback();
      }
    },
    error: function (xhr, ajaxOptions, thrownError) {
      alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    }
  });
};

$('select[name="zone_id"]').bind('change', function() {
  $('select[name="city_id"]').closest('.form-group').addClass('hidden');
  $('select[name="county_id"]').closest('.form-group').addClass('hidden');
  $('input[name="city"]').closest('.form-group').addClass('hidden');
  var changeEl = $('select[name="city_id"]');
  var cityId = '455';
  showCityOrCountyOptions($(this), changeEl, 1, cityId, function() {
    if ($('select[name="city_id"] option').length > 1) {
      $('select[name="city_id"]').closest('.form-group').removeClass('hidden');
      if ($('select[name="city_id"] option:selected').val() > 0) {
        changeEl.trigger('change');
      }
    } else {
      $('input[name="city"]').closest('.form-group').removeClass('hidden');
    }
  });
});

$('select[name="city_id"]').bind('change', function() {
  $('select[name="county_id"]').closest('.form-group').addClass('hidden');
  var changeEl = $('select[name="county_id"]');
  var countyId = '466';
  showCityOrCountyOptions($(this), changeEl, 0, countyId, function() {
    if ($('select[name="county_id"] option').length > 1) {
      $('select[name="county_id"]').closest('.form-group').removeClass('hidden');
    }
  });
});
//--></script>
  <footer>
        <div class="language-currency-wrapper mb-1 mt-1">
            <a href="#" id="switch-language">
    <img src="../../image/language/zh-cn.png" alt="简体中文" title="简体中文">
    简体中文
  </a>

  <script type="text/javascript">
  $('#switch-language').click(function (e) {
    e.preventDefault();
    layer.open({
      type: 1,
      title: '语言',
      closeBtn: 1,
      anim: 2,
      shadeClose: true,
      scrollbar: false,
      area: ['80%'],
      content: language_modal_content()
    });
  });

  function language_modal_content() {
    var html = '<div class="m-2">';
        html += '<a href="../../mobile/account/address/edit.html?address_id=244&language=zh-cn" class="list-group-item"><img src="../../image/language/zh-cn.png"/> 简体中文</a>';
        html += '<a href="../../mobile/account/address/edit.html?address_id=244&language=en-gb" class="list-group-item"><img src="../../image/language/en-gb.png"/> English</a>';
        html += '<a href="../../mobile/account/address/edit.html?address_id=244&language=zh-hk" class="list-group-item"><img src="../../image/language/zh-hk.png"/> 繁體中文</a>';
        html += '</div>';
    return html;
  }
  </script>

                      <a href="#" id="switch-currency">
      ￥  人民币
    </a>

  <script type="text/javascript">
  $('#switch-currency').click(function (e) {
    e.preventDefault();
    layer.open({
      type: 1,
      title: '货币',
      closeBtn: 1,
      anim: 2,
      shadeClose: true,
      scrollbar: false,
      area: ['80%'],
      content: currency_modal_content()
    });
  });

  function currency_modal_content() {
    var html = '<div class="m-2">';
        html += '<a href="../../mobile/account/address/edit.html?address_id=244&currency=USD" class="list-group-item">$ US Dollar</a>';
        html += '<a href="../../mobile/account/address/edit.html?address_id=244&currency=CNY" class="list-group-item">￥ 人民币</a>';
        html += '<a href="../../mobile/account/address/edit.html?address_id=244&currency=JPY" class="list-group-item">¥ 日元 </a>';
        html += '</div>';
    return html;
  }
  </script>

    </div>
        <div class="container">
      <div class="footer-powered">
        技术支持
      </div>
    </div>
  </footer>
      <nav id="bottom-tab-menu">
      <div class="menu-item">
        <a class="" href="../../mobile/index.html">
          <i class="iconfont">&#xe669;</i>
          <div class="name">首页</div>
        </a>
      </div>
      <div class="menu-item">
        <a class="" href="../../mobile/search.html">
          <i class="iconfont">&#xe602;</i>
          <div class="name">搜索</div>
        </a>
      </div>
      <div class="menu-item">
        <a class="" href="../../mobile/categories.html">
          <i class="iconfont">&#xe61d;</i>
          <div class="name">分类</div>
        </a>
      </div>
      <div class="menu-item cart">
        <a class="" href="../../mobile/cart.html">
          <i class="iconfont"><span class="cart-total" style="display:none;"></span>&#xe660;</i>
          <div class="name">购物车</div>
        </a>
      </div>
      <div class="menu-item">
        <a class="active" href="../../mobile/account.html">
          <i class="iconfont">&#xe640;</i>
          <div class="name">会员中心</div>
        </a>
      </div>
    </nav>

</body>
</html>
